package com.es.disped.dao.oj.mapper;

import com.es.disped.dao.oj.model.Online;
import com.es.disped.dao.oj.model.OnlineExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface OnlineMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table online
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=OnlineSqlProvider.class, method="countByExample")
    long countByExample(OnlineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table online
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @DeleteProvider(type=OnlineSqlProvider.class, method="deleteByExample")
    int deleteByExample(OnlineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table online
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Delete({
        "delete from online",
        "where hash = #{hash,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String hash);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table online
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Insert({
        "insert into online (hash, ip, ",
        "ua, refer, lastmove, ",
        "firsttime, uri)",
        "values (#{hash,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, ",
        "#{ua,jdbcType=VARCHAR}, #{refer,jdbcType=VARCHAR}, #{lastmove,jdbcType=INTEGER}, ",
        "#{firsttime,jdbcType=INTEGER}, #{uri,jdbcType=VARCHAR})"
    })
    int insert(Online record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table online
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @InsertProvider(type=OnlineSqlProvider.class, method="insertSelective")
    int insertSelective(Online record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table online
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @SelectProvider(type=OnlineSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="hash", property="hash", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
        @Result(column="ua", property="ua", jdbcType=JdbcType.VARCHAR),
        @Result(column="refer", property="refer", jdbcType=JdbcType.VARCHAR),
        @Result(column="lastmove", property="lastmove", jdbcType=JdbcType.INTEGER),
        @Result(column="firsttime", property="firsttime", jdbcType=JdbcType.INTEGER),
        @Result(column="uri", property="uri", jdbcType=JdbcType.VARCHAR)
    })
    List<Online> selectByExample(OnlineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table online
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Select({
        "select",
        "hash, ip, ua, refer, lastmove, firsttime, uri",
        "from online",
        "where hash = #{hash,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="hash", property="hash", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR),
        @Result(column="ua", property="ua", jdbcType=JdbcType.VARCHAR),
        @Result(column="refer", property="refer", jdbcType=JdbcType.VARCHAR),
        @Result(column="lastmove", property="lastmove", jdbcType=JdbcType.INTEGER),
        @Result(column="firsttime", property="firsttime", jdbcType=JdbcType.INTEGER),
        @Result(column="uri", property="uri", jdbcType=JdbcType.VARCHAR)
    })
    Online selectByPrimaryKey(String hash);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table online
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=OnlineSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Online record, @Param("example") OnlineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table online
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=OnlineSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Online record, @Param("example") OnlineExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table online
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @UpdateProvider(type=OnlineSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Online record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table online
     *
     * @mbg.generated Mon Jun 10 19:18:24 CST 2019
     */
    @Update({
        "update online",
        "set ip = #{ip,jdbcType=VARCHAR},",
          "ua = #{ua,jdbcType=VARCHAR},",
          "refer = #{refer,jdbcType=VARCHAR},",
          "lastmove = #{lastmove,jdbcType=INTEGER},",
          "firsttime = #{firsttime,jdbcType=INTEGER},",
          "uri = #{uri,jdbcType=VARCHAR}",
        "where hash = #{hash,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(Online record);
}